 
class Timer:
    def __init__(self):
        self.start = millis()
        self.final_time = None
        self.is_stop = False


    def stop(self):
        if self.is_stop  is False:
            self.final_time = millis()
            self.is_stop = True

    def time_pass(self):
        if  self.is_stop :
            d =self.final_time - self.start
        else:
            d = millis() - self.start
        d = int(d / 1000)
        return d        
    def reset(self):
        self.start = millis()
        self.final_time = None

    def show_game_time(self):
        d = self.time_pass()
        textSize(25)
        minute_ = int(d / 60)
        if minute_ < 10:
            minute_str = '0' + str(minute_)
        else:
            minute_str = str(minute_)
        sec_str = str(d % 60)
        if len(sec_str) == 1:
            sec_str = '0' + sec_str
        fill(255)
        text("{}:{}".format(minute_str, sec_str), 670, 80)
